package com.example.demo.pojo;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;
import java.util.List;

/**
 * User用户类
 */
@EqualsAndHashCode(callSuper = true)
@Data
@ApiModel(description = "用户")
@TableName("t_user")
public class SysUser extends Model<SysUser> implements Serializable{

    private static final long serialVersionUID = -6605435259054335400L;

    @Override
    public Serializable pkVal() {
        return this.id;  //primary key
    }

    @TableId//主键
    @ApiModelProperty(value = "id",name = "id",hidden = true)
    private Long id;

    @ApiModelProperty(value = "用户姓名",name = "name")
    private String name;
    @ApiModelProperty(value = "登录用户名",name = "username")
    private String username;
    @ApiModelProperty(value = "密码",name = "password")
    private String password;
    @ApiModelProperty(value = "性别",name = "sex")
    private Integer sex;

    //用户角色
    @TableField(exist = false)
    private List<Role> roles;

}
